#!/bin/bash

# change vars.yml version
sed -i "s|version.*|version: $1|g" src/main/resources/plays/vars.yaml

# create version.json
echo "
{
  \"project_name\": \"$CI_PROJECT_NAME\",
  \"project_id\": \"$CI_PROJECT_ID\",
  \"versiopn\": \"$1\",
  \"commit_ref_name\": \"$CI_COMMIT_REF_NAME\",
  \"commit_sha\": \"$CI_COMMIT_SHA\",
  \"commit_title\": \"$CI_COMMIT_TITLE\",
  \"build_time\": \"$(date)\"
}
" >>version.json
